//级别筛选
$('.leftShaiXuan').on('click',function(){
	if($(this).attr("hide") == "true"){
		$('#firstPopover').show();
		$('#secondPopover').hide();
		$(this).attr("hide","false")
		$('.rightShaiXuan').attr("hide","true")
	}else{
		$('#firstPopover').hide();
		$(this).attr("hide","true")
	}
})

//消费金额筛选
$('.rightShaiXuan').on('click',function(){
	if($(this).attr("hide") == "true"){
		$('#secondPopover').show();
		$('#firstPopover').hide();
		$('.leftShaiXuan').attr("hide","true")
		$(this).attr("hide","false")
	}else{
		$('#secondPopover').hide();
		$(this).attr("hide","true")
	}
})

//分销商级别筛选后列表
$('#firstPopover').find('li').on('click',function(){
	$('#firstPopover').hide();
	$('.leftShaiXuan').find('b').html($(this).html());
	var level = $(this).attr("level");
	var orderBy = $('.rightShaiXuan').find('b').html();
	$('#secondPopover').hide();
	$('.rightShaiXuan').attr("hide","true");
	$('.leftShaiXuan').attr("hide","true");
	$.ajax({
		type:"POST",
		url : "/maidian/distributor/distributorListMore.htm",
		dataType : "html",
		data : {
			"level" :level,
			"orderBy" :orderBy
		},
		success : function(data) {
			$('.distributorWrap').html(data);
		}
	});
})

//分销商消费金额筛选后列表
$('#secondPopover').find('li').on('click',function(){
	$('#secondPopover').hide();
	$('.rightShaiXuan').find('b').html($(this).html());
	var boderBy = $(this).attr("boderBy");
	var level = $('.leftShaiXuan').find('b').html();
	$('.rightShaiXuan').attr("hide","true");
	$('#firstPopover').hide();
	$('.leftShaiXuan').attr("hide","true");
	
	$.ajax({
		type:"POST",
		url : "/maidian/distributor/distributorListMore.htm",
		dataType : "html",
		data : {
			"level" :level,
			"orderBy" :orderBy
		},
		success : function(data) {
			$('.distributorWrap').html(data);
		}
	})
})